package com.flower.service.impl;

import com.flower.dao.OrderMapper;
import com.flower.pojo.Order;
import com.flower.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public int getOid() {
        List<Order> list = orderMapper.queryAll();
        if(list.size()>0){
            return orderMapper.getOid();
        }else{
            return 1;
        }
    }

    @Override
    public int addOrder(Order order) {
        return orderMapper.addOrder(order);
    }
}
